#Scoreboards Init
scoreboard objectives add temp dummy
scoreboard objectives add system dummy
scoreboard objectives add StreamMinecart dummy
scoreboard objectives add anim_timer dummy
scoreboard objectives add invulnerable_timer dummy
scoreboard objectives add number dummy
scoreboard objectives add short_circuit_timer dummy
scoreboard objectives add Power dummy
scoreboard objectives add HP health
scoreboard objectives add SpawnTime dummy
scoreboard objectives add PlayerKill playerKillCount
scoreboard objectives add PlayerKillCount playerKillCount
scoreboard objectives add KillReward dummy
scoreboard objectives add SwordCount dummy
scoreboard objectives add ArmorCount dummy
scoreboard objectives modify KillReward rendertype hearts
scoreboard objectives add TimeToTick dummy
scoreboard objectives add Death deathCount
scoreboard objectives add RewardGet dummy
scoreboard objectives add OptionChange trigger
scoreboard objectives add winCount dummy "胜利次数"
scoreboard objectives add timer dummy
scoreboard objectives add y dummy
scoreboard objectives add voidogenItemTime dummy
scoreboard objectives add leave_game minecraft.custom:minecraft.leave_game
scoreboard objectives add teleportDeviceTime dummy

    #number
    scoreboard players set 2 number 2
    scoreboard players set 10 number 10
    scoreboard players set 20 number 20

    #init gamerules
    function vs:system/game/rules/init

execute unless score game_run system matches -2147483648..2147483647 run scoreboard players set game_run system 0
execute unless score only_init system matches -2147483648..2147483647 run scoreboard players set only_init system 0

#Teams Init
team add red
team add blue
team add spectator
team modify blue friendlyFire false
team modify red friendlyFire false
team modify blue nametagVisibility hideForOtherTeams
team modify red nametagVisibility hideForOtherTeams
team modify blue seeFriendlyInvisibles true
team modify red seeFriendlyInvisibles true
team modify blue color blue
team modify red color red
team modify spectator color gray
team modify spectator prefix [{"text":"[观战]","color":"gray"}]

bossbar add game_starting ""
bossbar set game_starting max 100
bossbar set game_starting color green

bossbar add devour_coming ""
bossbar set devour_coming style notched_6
bossbar set devour_coming color purple

#Vanilla Gamerules
gamerule commandBlockOutput false
gamerule sendCommandFeedback false
gamerule keepInventory true
gamerule doImmediateRespawn true

#Game Init
execute unless entity @e[tag=Minecart] run kill @e[tag=minecartContrl,type=marker]
function vs:system/game_ctrol/void_shop/init_items

#Hub Entity
#function vs:hub_entity
execute as @e[tag=Hub] at @s run data merge entity @s {DisabledSlots:16191,Invulnerable:1b}